<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh" xml:lang="zh" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Guideline: Service</title>
<meta name="uma.type" content="Guideline">
<meta name="uma.name" content="service">
<meta name="uma.presentationName" content="Service">
<meta name="element_type" content="other">
<meta name="filetype" content="description">
<meta name="role" content="">
<link rel="StyleSheet" href="./../../../css/default.css" type="text/css">
<script src="./../../../scripts/ContentPageResource.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/ContentPageSection.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/ContentPageSubSection.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/ContentPageToolbar.js" type="text/javascript" language="JavaScript"></script><script src="./../../../scripts/contentPage.js" type="text/javascript" language="JavaScript"></script><script type="text/javascript" language="JavaScript">
					var backPath = './../../../';
					var imgPath = './../../../images/';
					var nodeInfo=null;
					contentPage.preload(imgPath, backPath, nodeInfo,  '', false, false, false);
				</script>
</head>
<body>
<div id="breadcrumbs"></div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><a name="Top"></a>
<div id="page-guid" value="2.1757522381974088E-306"></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="pageTitle" nowrap="true">Guideline: Service</td><td width="100%">
<div align="right" id="contentPageToolbar"></div>
</td><td width="100%" class="expandCollapseLink" align="right"><a name="mainIndex" href="./../../../index.htm"></a><script language="JavaScript" type="text/javascript" src="./../../../scripts/treebrowser.js"></script></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="pageTitleSeparator"><img src="./../../../images/shim.gif" alt="" title="" height="1"></td>
</tr>
</table>
<div class="overview">
<table width="97%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"><img src="./../../../images/guidance.gif" alt="" title=""></td><td>
<table class="overviewTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">This guideline elaborates on the definition of a service as a discoverable software resource with an externalized service specification.</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="sectionHeading">Relationships</div>
<div class="sectionContent">
<table class="sectionTable" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<th class="sectionTableHeading" scope="row">Related Elements</th><td class="sectionTableCell">
<ul>
<li>
<a href="./../../../rup_soa_plugin/workproducts/soa_svce_model_service_1EE4C96C.html" guid="{FF65B0A2-6C53-4F01-9727-AACDB0D542C8}">Service</a>
</li>
</ul>
</td>
</tr>
</table>
</div>
<div class="sectionHeading">Main Description</div>
<div class="sectionContent">
<table class="sectionTable" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td class="sectionTableSingleCell"><a id="XE_service__guidelines_for" name="XE_service__guidelines_for"></a> 
<h3>
    <a id="Introduction" name="Introduction">Introduction</a>
</h3>
<p>
    A service is the key artifact in a <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/concepts/service-oriented_architecture_8328ABAD.html" guid="8.613638237693525E-307">Service-Oriented Architecture</a></i>, but what is a service? The following is the entry
    from the Neusoft Unified Process (RUP) glossary.
</p>
<blockquote>
    <i>A service is a software resource (discoverable) with an externalized service specification. This service
    specification is available for searching, binding, and invocation by a service consumer. The service provider realizes
    the service specification implementation and also delivers the quality of service requirements to the service consumer.
    Services shall be governed by declarative policies and thus support a dynamically re-configurable architectural
    style.</i>
</blockquote>
<p>
    And, while the following section outlines some of the key statements in the entry above, it is worth noting an
    additional aspect of services that really differentiate them from design elements in previous technologies; services
    are at a level of granularity that allows them to be identified from a business level. Thus below we will also discuss
    the business aligned nature of services.
</p>
<h4>
    <a id="Discoverable" name="Discoverable">Discoverable</a>
</h4>
<p>
    Services are not a part of a monolithic application architecture. They exist independently at run time from any and all
    other services within a given solution. This means that we require a method for the registration and discovery of
    services based on criteria such as the <i><a class="elementLinkWithUserText" href="./../../../rup_soa_plugin/workproducts/soa_svce_model_svce_spec_37E89A91.html" guid="{20F06B5E-95D5-422C-AB68-7C213D28533A}">Service Specifications</a></i> it realizes, its <i><a class="elementLink" href="./../../../rup_soa_plugin/workproducts/soa_svce_model_svce_provider_C00D3410.html" guid="{8427751F-3C14-4CEB-9816-5112BDB91EED}">Service Provider</a></i>, as well as other business and technical
    classifications. This discovery process may take place during development time to match given services to supporting
    services or it may take place at run time to enable the dynamic provisioning of services (mediated invocation). To be
    discoverable, a service must provide a set of metadata that allows categorization. This metadata is a part of the
    external specification.
</p>
<p>
    For more information, see the concept <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/concepts/service_portfolio_52FD64AC.html" guid="1.851952881072508E-305">Service Portfolio</a></i> and the guideline <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/guidelines/service_mediation_2F2C4C02.html" guid="2.5614739075754752E-306">Service Mediation</a></i>.
</p>
<h4>
    <a id="Externally_Described" name="Externally_Described">Externally</a> Specified
</h4>
<p>
    The external specification allows for a service to publish its details such as interface, location, policies,
    classifications, and so on without the need for a client to have access to the service itself. Such information is then
    usually stored in a known location or specialized service registry that supports queries of the metadata. Currently in
    the Web Services world, the accepted standard for the description of service interfaces is WSDL (<a href="http://www.w3.org/TR/wsdl">Web Services Description Language)</a>, which comes from the World Wide Web
    Consortium.
</p>
<p>
    The service specification work product is actually a combination of three parts: the interface, behavior, and policy
    specification. As such, the realization of these different aspects requires more than simply the interface definition
    provided by WSDL.
</p>
<p>
    For more information on service registries, see the concept <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/concepts/service_portfolio_52FD64AC.html" guid="1.851952881072508E-305">Service Portfolio</a></i>.
</p>
<h4>
    <a id="Contract_Based" name="Contract_Based">Contract-Based</a>
</h4>
<p>
    In the glossary definition above we noted that the service specification provides a view for both the service provider
    as well as the service consumer. These views correspond to two halves of a contract that allows the clear separation of
    the specification from implementation.
</p>
<p>
    The following table describes how the different aspects of a service specification effect both the provider and
    consumer of the specification.
</p>
<table width="100%" border="1">
    <tbody>
        <tr>
            <th valign="top" width="10%">
                Role
            </th>
            <th valign="top" width="30%">
                Interface Specification
            </th>
            <th valign="top" width="30%">
                Behavior Specification
            </th>
            <th valign="top" width="30%">
                Policy Specification
            </th>
        </tr>
        <tr>
            <td valign="top" width="10%">
                <b>Provider</b>
            </td>
            <td valign="top" width="30%">
                Informs the set of operations and messages the service must respond to. All operations must respond to and
                reply with the correct messages.
            </td>
            <td valign="top" width="30%">
                Informs as to the behavior this service must support. If such behavior specification is formal and
                complete, an implementation can be tested for conformance to the specification.
            </td>
            <td valign="top" width="30%">
                Informs as to a set of constraints which the service implementation may work under as well as a set of
                qualities of service that must be realized.
            </td>
        </tr>
        <tr>
            <td valign="top" width="10%">
                <b>Consumer</b>
            </td>
            <td valign="top" width="30%">
                Informs the set of operations that may be invoked.
            </td>
            <td valign="top" width="30%">
                Informs as to the protocol requirements that the consumer must realize (operation ordering, data flows, and
                so on). Also indicates any operations the consumer must implement to support collaborations.
            </td>
            <td valign="top" width="30%">
                Informs as to constraints that the consumer must be cognizant of, such as security requirements, in
                communicating with this service. It also identifies the qualities of service a consumer can get from a
                given provider.
            </td>
        </tr>
    </tbody>
</table>
<p>
    Such a service specification can be seen as an application of the Design by Contract but is a necessary step in
    achieving discoverable and dynamically reconfigurable services.
</p>
<h4>
    <a id="Business_Aligned" name="Business_Aligned">Business Alignment</a>
</h4>
<p>
    In general, the connection between business models representing the operations of the business and the design models
    for supporting IT applications have been at best loosely connected. In most cases, they have been completely
    disconnected. While the NUP does provide guidance on the transition from business models to system use case models (see
    the guideline <i>Going from Business Models to Systems</i>), the connection requires a number of transformations as the
    level of granularity and abstraction changes from the business to IT perspectives.
</p>
<p>
    In general, it is clear that services may be classified into either business or infrastructure services. See the
    concept <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/concepts/service_portfolio_52FD64AC.html" guid="1.851952881072508E-305">Service Portfolio</a></i> for a discussion of service classifications.
</p>
<p>
    One important aspect of SOAs is that the level of granularity of services described in a service-oriented solution is
    such that the operations provided by services can often be identified at a business level. This increase in the level
    of granularity in supporting IT means that, in many cases, tasks identified in business-process models can be directly
    realized as operations on services. Therefore the business users of IT solutions become much more a part of the
    analysis and design process. It is also interesting to note that this closer connection with the business process model
    also more directly associates services as IT work products, with the <i>Business Goals</i> modeled in the RUP
    business-modeling discipline.
</p>
<p>
    For more details on the connection between business and service models, see the task <i><a class="elementLink" href="./../../../rup_soa_plugin/tasks/identify_services_565F8B8A.html" guid="{0BF79161-A484-4C48-B72D-DA381DA05886}">Identify Services</a></i>.
</p>
<h3>
    <a id="Modeling_Service" name="Modeling_Service">Modeling a Service</a>
</h3>
<p>
    In modeling the service, use the <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/whitepapers/uml_profile_for_software_services_7ADFB3D2.html" guid="2.972928238097629E-306">Unified Modeling Language (UML) Profile for Software Services</a></i> and the guidance
    provided for each element in the profile. In general, elements that make up the static view of services and service
    specifications in a service model are shown in the diagram below.
</p>
<p align="center">
    <img height="162" alt="Diagram is described in the textual content." src="./../../../rup_soa_plugin/guidances/guidelines/resources/soa_svce_identification-01.gif"     width="512" border="0" />
</p>
<ul>
    <li>
        The Service Provider "UpdateCustomerAddressLegacyProvider" provides a Service "UpdateCustomerAddress."
    </li>
    <li>
        The Service "UpdateCustomerAddress" implements the Service Specification "IUpdateCustomerAddress."
    </li>
    <li>
        The Service Specification "IUpdateCustomerAddress" has a single Operation "execUpdateCustomerAddress."
    </li>
    <li>
        The Operation "execUpdateCustomerAddress" takes a single input message, "UpdateCustomerRequest."
    </li>
    <li>
        The Operation "execUpdateCustomerAddress" returns a single output message, "UpdateCustomerResponse."
    </li>
</ul>
<p>
    The structure and composition view of the model capture the communication between services and the partitioning of the
    solution. This is addressed in the concepts <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/concepts/service_composition_and_choreography_41EDEECB.html" guid="7.723783423994501E-306">Service Composition and Choreography</a></i> and <i><a class="elementLinkWithUserText" href="./../../../rup_soa_plugin/guidances/concepts/solution_partitioning_352116F8.html" guid="1.6501323286225543E-305">Service Partitioning</a></i>.
</p>
<p>
    For information on the design and implementation of services, see the guideline <i><a class="elementLink" href="./../../../rup_soa_plugin/guidances/guidelines/going_from_services_to_service_components_914EA328.html" guid="2.4211910729992714E-305">Going from Services to Service Components</a></i>.
</p></td>
</tr>
</table>
</div>
<table class="copyright" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="copyright">Copyright &copy; 2008 版权所有 东软集团股份有限公司&nbsp; 联系邮箱:<a href="mailto:tcoe@neusoft.com">tcoe@neusoft.com</a></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<script type="text/javascript" language="JavaScript">
				contentPage.onload();
			</script>
</html>
